{template 'common/header'}
{template 'common'}
<ul class="nav nav-tabs">
    <li {if $operation=='display'} class="active" {/if}>
        <a href="{php echo $this->createWebUrl('member',array('op' =>'display'))}">用户列表</a>
    </li>
    {if !empty($member['id']) && $operation == 'detail'}
    <li class="active">
        <a href="{php echo $this->createWebUrl('member',array('op' =>'detail','id'=>$member['id']))}">用户详细</a>
    </li>
    {/if}
</ul>

<!--列表-->
{if $operation == 'display'}
<div class="main panel panel-default">
    <div class="panel-body table-responsive">
        <table class="table table-hover">
            <thead class="navbar-inner">
            <tr>
                <th style="width:45px;">ID</th>
                <th style='width:50px;'>头像</th>
                <th style="min-width:90px;">真实姓名</th>
                <th style="min-width:100px;">昵称</th>
                <th style="min-width:120px;">手机/openid</th>
                <th style="min-width:120px;">注册时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list $item}
            <tr>
                <td>{$item['id']}</td>
                <td><img src="{$item['avatar']}" width="30px" height="30px"></td>
                <td>{$item['real_name']}</td>
                <td>{$item['nick_name']}</td>
                <td>
                    <div>{$item['mobile']}</div>
                    <div>{$item['openid']}</div>
                </td>
                <td>{php echo date('y-m-d H:i',$item['created_at'])}</td>
                <td style="text-align:left;">
                    <a href="{php echo $this->createWebUrl('member', array('op' => 'detail', 'id' => $item['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="用户详细">
                        <i class="fa fa-user"></i>
                    </a>
                    <a href="{php echo $this->createWebUrl('singleorder', array('op' => 'display', 'm_id' => $item['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="单品订单">
                        <i class="fa fa-navicon "></i>
                    </a>
                    <a href="{php echo $this->createWebUrl('onedayorder', array('op' => 'display', 'm_id' => $item['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="一日游订单">
                        <i class="fa fa-navicon "></i>
                    </a>
                    <a href="{php echo $this->createWebUrl('qualityorder', array('op' => 'display', 'm_id' => $item['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="精品游订单">
                        <i class="fa fa-navicon "></i>
                    </a>
                    <a href="{php echo $this->createWebUrl('insuranceorder', array('op' => 'display', 'm_id' => $item['id']))}"
                       class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="保险订单">
                        <i class="fa fa-navicon "></i>
                    </a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
</div>
<script>
    require(['bootstrap'], function ($) {
        $('.btn').hover(function () {
            $(this).tooltip('show');
        }, function () {
            $(this).tooltip('hide');
        });
    });
</script>

{elseif $operation == 'detail'}
<div class="main">
    <div class="panel panel-default">
        <div class="panel-heading">
            用户基本信息
        </div>
        <div class="panel-body form-horizontal">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">头像</label>
                <div class="col-sm-9 col-xs-12">
                    <img src="{$member['avatar']}" width="100px" height="100px">
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    openid
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$member['openid']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    真实姓名
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$member['real_name']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    微信昵称
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$member['nick_name']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    手机号码
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$member['mobile']}" disabled/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                    邮箱
                </label>
                <div class="col-sm-9 col-xs-12">
                    <input class="form-control" value="{$member['email']}" disabled/>
                </div>
            </div>
        </div>
    </div>

    <div class="col-sm-12">
        <a href="javascript:history.back();" class="btn btn-primary col-lg-1">返回</a>
    </div>
</div>

{/if}
{template 'common/footer'}